<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    class Star{ // 明星
        play(){ // 来耍
            console.log('去演出')
        }
    }
    // 经纪人
    class StarProxy{
        constructor() {
            this.superStar = new Star()
        }
        talk(price){ // 谈价钱
            if(price>=10000){
                this.superStar.play() //
            }else{
                throw new Error('价格太低了吧')
            }
        }
    }
    let people = new StarProxy()
    people.talk(10001) // 去演出
    people.talk(8000) // 价格太低了吧
</script>

</body>
</html>
